package com.spice.service.entity.pojo;

import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableName;
import com.spice.common.constant.PermissionConstant;
import com.spice.common.model.BaseEntity;
import com.spice.common.util.DateUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.Valid;

@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName(PermissionConstant.PRODUCT_MAINTAIN)
@ApiModel(description = "产品维护档案表")
public class ProductMaintain extends BaseEntity {
    @ApiModelProperty(value = "系列名称",example = "烧烤料")
    @ExcelProperty({"档案维护","系列名称"})
    private String serialName;

    @ApiModelProperty(value = "产品名称",example = "110奥尔良烧烤酱")
    @ExcelProperty({"档案维护","产品名称"})
    private String productName;

    @ApiModelProperty(value = "更新时间",example = "2021-11-5")
    @ExcelProperty({"档案维护","更新时间"})
    private String productUpdateTime;

    @ApiModelProperty(value = "更新原因、内容",example = "产品升级")
    @ExcelProperty({"档案维护","更新原因、内容"})
    private String updateReason;

    @ApiModelProperty(value = "维护人",example = "张晓成")
    @ExcelProperty({"档案维护","维护人"})
    private String maintainer;

    @ApiModelProperty(value = "升级前 成本",example = "")
    @ExcelProperty({"维护内容","升级前","成本1"})
    private String costBeforeUpdate;

    @ApiModelProperty(value = "升级前 体态",example = "")
    @ExcelProperty({"维护内容","升级前","体态1"})
    private String shapeBeforeUpdate;

    @ApiModelProperty(value = "升级前 汤色",example = "")
    @ExcelProperty({"维护内容","升级前","汤色1"})
    private String soupColorBeforeUpdate;

    @ApiModelProperty(value = "升级前 口味",example = "")
    @ExcelProperty({"维护内容","升级前","口味1"})
    private String flavorBeforeUpdate;

    @ApiModelProperty(value = "升级前 规格",example = "")
    @ExcelProperty({"维护内容","升级前","规格"})
    private String specificationBeforeUpdate;

    @ApiModelProperty(value = "升级后 成本",example = "")
    @ExcelProperty({"维护内容","升级后","成本2"})
    private String costAfterUpdate;

    @ApiModelProperty(value = "升级后 体态",example = "")
    @ExcelProperty({"维护内容","升级后","体态2"})
    private String shapeAfterUpdate;

    @ApiModelProperty(value = "升级后 汤色",example = "")
    @ExcelProperty({"维护内容","升级后","汤色2"})
    private String soupColorAfterUpdate;

    @ApiModelProperty(value = "升级后 口味",example = "")
    @ExcelProperty({"维护内容","升级后","口味2"})
    private String flavorAfterUpdate;

    @Override
    public ProductMaintain cleanup() {
        super.cleanup();
        this.setProductUpdateTime(DateUtil.getNowDate());
        return this;
    }
}
